using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using SystemFrameworks;
using SystemFrameworks.Common;

namespace SystemFrameworks.Ecryption
{
	/// <summary>
	/// Summary description for UserKey.
	/// </summary>
	public class UserKey
	{
		public UserKey()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		public static string GetUserKey
		{
			get
			{
				string pb_key=ConfigurationSettings.AppSettings["KeyWords"];
				if ((pb_key==null || pb_key.Length <=0))
					throw (new ApplicationException("Connection String configuration is missing from config. "));
				try
				{
					pb_key=SystemFrameworks.Ecryption.Safe.Decrypt(pb_key,Constants.SYSTEMKEYWORDS );
				 	
			
				}
				catch(Exception ex)
				{
					throw (new ApplicationException("Connection String configuration is missing from config.",ex));
				}
				 
				return (pb_key);

			}

		}
	}
}
